﻿@model IEnumerable<HelloMinasan.Domain.InternalMessage>
@{
    ViewBag.Title = "Read Mail";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="contentSection">
    <div class="titleSection">
        <img src="@Url.Content("~/Content/Images/messagenew.png")" width="20" height="20"/>
        <span class="titleTab">Mail Box</span>
    </div>
    <div class="contentSectionInside">
        <table width="100%">
            <tr>
                <td valign="top" style="width: 100px">
                    <a href="@Url.Content("~/MailBox/UnreadMail")" class="unreadMail">
                        <img src="@Url.Content("~/Content/Images/messagenew.png")" />
                        Unread mail</a>
                    <a href="@Url.Content("~/MailBox/ReadMail")" class="unreadMail">
                        <img src="@Url.Content("~/Content/Images/sentmail.png")" />
                        Read mail</a>
                    <a href="@Url.Content("~/MailBox/ComposeMail")" class="unreadMail">
                        <img src="@Url.Content("~/Content/Images/composer.png")" />
                        Compose mail</a>
                </td>
                <td valign="top" style="border: 1px solid #ccc;">
                    @foreach (var item in Model)
                    {
                        <a href="@Url.Action("ViewMessage", "MailBox", new { id = item.MessageId })">
                            <div class="mailContainer">
                                <div class="titleMail">@item.MessageTitle</div>
                                <div>
                                    @if (item.MessageContent.Length > 100)
                                    {
                                        @item.MessageContent.Substring(0, 100)
                                    }
                                    else
                                    {
                                        @item.MessageContent
                                    }
                                    ...
                                </div>
                                <div class="datetime">@item.PostedDate.ToShortDateString() : @item.PostedDate.ToShortTimeString()</div>
                            </div>
                        </a>
                    }
                </td>
            </tr>
        </table>
    </div>
</div>
